﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Windows.Forms;

namespace Chess.Dummy
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
        }

        private void Main_Load(object sender, EventArgs e)
        {
            IPAddress ip = IPAddress.Parse("127.0.0.1");
            IPEndPoint endPoint = new IPEndPoint(ip, 1000);
            TcpClient client = new TcpClient();
            client.Connect(endPoint);
            StreamReader reader = new StreamReader(client.GetStream());
            StreamWriter writer = new StreamWriter(reader.BaseStream);
            writer.WriteLine(string.Format("my number: {0}", new Random().Next(0, 100)));
            writer.Flush();
        }
    }
}
